package com.cy.pj.sys.commom.Util分页查询的工具类;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import javax.servlet.http.HttpServletRequest;

public class PageUtil {

    public static <T> Page<T> startPage() {
        HttpServletRequest request = ServletUtil.getRequest();
        String pageCurrentStr = request.getParameter("PageCurrent");
        String pageSizeStr = request.getParameter("PageSize");
        int PageCurrent = StringUtil.isEmpty(pageCurrentStr) ? 1 : Integer.parseInt(pageCurrentStr);
        int PageSize = StringUtil.isEmpty(pageSizeStr) ? 10 : Integer.parseInt(pageSizeStr);

        return PageHelper.startPage(PageCurrent, PageSize);
    }
}
